<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title></title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}
	</style>
	<script type="text/javascript">
		window.onload = function  () {
			box = document.getElementById("box");
			big = document.getElementById("big");
			small = document.getElementById("small");
			stop = document.getElementById("stop");

			width = window.getComputedStyle ? window.getComputedStyle(box,null).width :box.currentStyle.width;
			height = window.getComputedStyle ? window.getComputedStyle(box,null).height :box.currentStyle.height;
			width= parseInt(width);
			height= parseInt(height);

			function bd () {
				height+=10;
				width +=10;
				box.style.width=width+'px';
				box.style.height=height+'px';
			}

			function bx () {
				height-=10;
				width -=10;
				box.style.width=width+'px';
				box.style.height=height+'px';
			}


			big.onclick = function  () {
				
				time = setInterval(bd,50)
	
			}

			stop.onclick = function  () {
				clearInterval(time);
			}

			small.onclick = function  () {
				
				time = setInterval(bx,50)
	
			}

			// box.onmouseover = function  () {
			// 	// alert(width);
			// 	// box.style.width = "300px";
			// 	// box.style.height = "300px";
			// 	// 
			// 	width = window.getComputedStyle ? window.getComputedStyle(box,null).width :obj.currentStyle.width;
				
			// 	width= parseInt(width); 
			// 	// alert(width);
			// 	width =  width+50;

			// 	box.style.width=width+"px";

			// }

			// box.onmouseout = function  () {
			// 	// box.style.width = "200px";
			// 	// box.style.height = "200px";
			// 	// box.style.backgroundColor ="blue";
			// }
		}

	</script>

</head>
<body>
	<input type="button" id="big" value="变大">
	<input type="button" id='small' value="变小">
	<input type="button" id='stop' value="停">
	<div class="box"  id="box">
		
	</div>
</body>
</html>